{extend name="layout:default" /}

{block name="title"}教师明细{/block}

{block name="content"}
<link href="https://cdn.bootcss.com/layer/2.2/skin/layer.css" rel="stylesheet">
<div class="row">

    <div class="col-xs-12">

        <div class="box">

            <div class="box-header">

                <h3 class="box-title">教师明细</h3>
            </div>
            <a href="{:url('index')}" class="btn btn-info">返回</a>
            <!-- /.box-header -->

            <div class="box-body table-responsive no-padding">

                <table class="table table-hover">
                    <tbody>
                    <tr>
                        <th>序号</th>
                        <th>头像</th>
                        <th>姓名</th>
                        <th>职位职称</th>
                        <th>添加时间</th>
                    </tr>
                    {volist name="teachers" id="vo"}
                    <tr>
                        <td>{$vo.id}</td>
                        <td><img src="{$vo.head_url}" alt="" width="50"></td>
                        <td>{$vo.name}</td>
                        <td>{$vo.zhiwu}</td>
                        <td>{:date('Y-m-d H:s:m', $vo.addtime)}</td>
                    </tr>
                    {/volist}
                    </tbody>

                </table>
            </div>
            <!-- /.box-body -->
        </div>
        <!-- /.box -->
    </div>
</div>

{/block}

{block name="js"}

<script src="https://cdn.bootcss.com/layer/2.2/layer.js"></script>
<script>
    // 审核
    $('.pass').click(function () {
        $('#modal-pass').modal();
        let id = $(this).data('id');
        $('#submit-save').click(function () {
            let classId= $('#class_id').val();
            $.post('/admin/cadre/pass', {'id':id, "class_id": classId}, function (data) {
                $('#modal-pass').modal('hide');
                if (data.code == 200) {let icon = 1}
                else  {icon = 2};
                layer.msg(data.message, {icon: icon});
            });

        });
    });
    function status(obj, id) {
        let s = +($(obj).prop("checked"));
        console.log(s, id);
        $.post('/admin/classes/status', {id:id, status: s}, function (data) {
            if (data.status == 200) {
                layer.msg(data.message, {icon: 1})
            } else {
                layer.msg(data.message, {icon: 2})
            }
        });
    }
</script>
{/block}